package com.zh.idservice.ordercode.service;

public class GenOrderThred implements Runnable {
    private OrderCodeService orderCodeService;
    private static final String INSERTSQL = "insert into orderCode ('orderCode') values ('%s')";

    public GenOrderThred(OrderCodeService orderCodeService) {
        this.orderCodeService = orderCodeService;
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            String orderCode = orderCodeService.createOrderCode();
            System.out.println(String.format(INSERTSQL, orderCode));
        }
    }
}
